def moveToEdge(motorCtl, touch, targetAngle: int = 0):
    print(
        "^ [INF] Moving motor %s to edge at angle %d, please press touch sensor to stop ..."
        % (motorCtl.name, targetAngle)
    )
    print(
        "^ [WAN] This will reset the motor angle to your target angle while touch sensor pressed."
    )

    if not touch.pressed():
        motorCtl.rotate(360, pauser=lambda: touch.pressed())

    motorCtl.set_angle(targetAngle)


def abs(x):
    return x if x >= 0 else -x
